#ifndef _ESBTREE_H_
#define _ESBTREE_H_

#include "btree.h"
#include "histogram.h"
#include "statistic.h"

typedef struct esbt_tree {
	short order;
	statistic * stat;
	histogram * his;
	struct bt_node * root;
} esbt_tree;

extern esbt_tree * esbtree_create(short order);
extern void esbtree_search(esbt_tree * esbtree, bt_entry * entry, bt_entry * search_result);
extern void esbtree_insert(esbt_tree * esbtree, bt_entry * entry);
extern void esbtree_delete(esbt_tree * esbtree, bt_entry * entry);
extern void esbtree_destroy(esbt_tree * esbtree);

static short  es_index_trace[MAX_TREE_LEVEL];
static bt_node * es_node_trace[MAX_TREE_LEVEL];
#endif